import config from './common.js';
export default function getData(url,data,method = 'POST'){
	return new Promise((resolve,reject)=>{
		uni.request({
			url:config.domain + '/ship.php/' + url,
			data:data,
			method:method,
			header: {
				// token:uni.getStorageSync('uToken')?uni.getStorageSync('uToken'):'',
				'Content-Type': 'application/x-www-form-urlencoded',
			},
			success: (res) => {
				// console.log(res);
				if(res.data.code == 200){
					resolve(res.data.data);
				}else{
					uni.showToast({
						title:res.data.message,
						icon:"none"
					})
					resolve(false);
				}
			},
			fail:(err)=>{
				console.log(err);
			}
		})
	})
}